Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cmake-js

Package Overview
Dependencies
Maintainers
2
Versions
85
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cmake-js

CMake.js - a Node.js/io.js native addon build tool

  • 6.3.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
181K
increased by45.9%
Maintainers
2
Weekly downloads
 
Created

What is cmake-js?

The cmake-js npm package is a tool that simplifies the process of building native C++ addons for Node.js using CMake. It provides a seamless integration between Node.js and CMake, allowing developers to leverage the powerful build system of CMake while working within the Node.js ecosystem.

What are cmake-js's main functionalities?

Building Native Addons

This feature allows you to build native C++ addons for Node.js using CMake. The code sample demonstrates how to use cmake-js to build a target named 'myAddon' in debug mode.

const cmake = require('cmake-js');

cmake.build({
  target: 'myAddon',
  debug: true
}).then(() => {
  console.log('Build complete');
}).catch(err => {
  console.error('Build failed', err);
});

Configuring Build Options

This feature allows you to configure various build options for your CMake project. The code sample shows how to set the build type to 'Release' and specify an installation prefix.

const cmake = require('cmake-js');

cmake.configure({
  CMAKE_BUILD_TYPE: 'Release',
  CMAKE_INSTALL_PREFIX: '/usr/local'
}).then(() => {
  console.log('Configuration complete');
}).catch(err => {
  console.error('Configuration failed', err);
});

Running CMake Commands

This feature allows you to run arbitrary CMake commands. The code sample demonstrates how to run a CMake build command to install the target.

const cmake = require('cmake-js');

cmake.run(['--build', '.', '--target', 'install']).then(() => {
  console.log('CMake command executed successfully');
}).catch(err => {
  console.error('CMake command failed', err);
});

Other packages similar to cmake-js

Keywords

FAQs

Package last updated on 06 Jun 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc